package com.foxzzz.link;


import com.foxzzz.base.ListNode;

public class Solution1290 {

    public int getDecimalValue(ListNode head) {
        int res = 0;
        while (head != null) {
            res = res <<1 | head.val;
            head = head.next;
        }
        return res;
    }
}
